package com.tally.project.system.billing.domain;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.tally.framework.web.BaseEntity;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 账目流水信息对象 billing
 * @author soul
 * @date 2023-05-14
 */
public class Billing extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 唯一ID */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /** 关联用户 */
    @ApiParam(hidden = true)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @ApiParam(name = "账单类型 0.收入 1.支出", value = "type")
    private Integer type;

    @ApiParam(name = "账本ID", value = "bookId")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long bookId;

    @ApiParam(name = "收支分类ID", value = "categoryId")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long categoryId;

    @ApiParam(name = "金额", value = "amount")
    private BigDecimal amount;

    @ApiParam(name = "年-冗余统计", value = "year")
    private Integer year;

    @ApiParam(name = "月-冗余统计", value = "month")
    private Integer month;

    @ApiParam(name = "周数", value = "week")
    private String week;

    @ApiParam(name = "日-冗余统计", value = "day")
    private int day;

    /** 日期 */
    @ApiParam(name = "日期", value = "date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime date;

    @ApiParam(name = "图片", value = "image")
    private String image;

    @ApiParam(name = "支付方式", value = "payment")
    private String payment;

    private long timestamp;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }
    public void setType(Integer type)
    {
        this.type = type;
    }

    public Integer getType()
    {
        return type;
    }

    public long getBookId() {
        return bookId;
    }

    public void setBookId(Long bookId) {
        this.bookId = bookId;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    public String getWeek() {
        return week;
    }

    public void setWeek(String week) {
        this.week = week;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public LocalDateTime getDate() {
        return date;
    }

    public void setDate(LocalDateTime date) {
        this.date = date;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getPayment() {
        return payment;
    }

    public void setPayment(String payment) {
        this.payment = payment;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("type", getType())
            .append("bookId", getBookId())
            .append("categoryId", getCategoryId())
            .append("amount", getAmount())
            .append("year", getYear())
            .append("month", getMonth())
            .append("week", getWeek())
            .append("day", getDay())
            .append("date", getDate())
            .append("image", getImage())
            .append("remark", getRemark())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("payment", getPayment())
            .toString();
    }
}
